package com.whale.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class ValidUtil {

    public static boolean checkEmail(String email) {
        // String regex = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$";
        // String regex = "^\\w+@([^@]+\\.)[a-zA-Z]{2,3}$";
        String regex = "^\\w+@\\w+\\.(com\\.cn)|\\w+@\\w+\\.(com|cn)$";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(email);
        return matcher.find();
    }
}
